package edu.sctu.zcy.month201505.subwaysystem.V3;

/**
 * Created by user24 on 2015/6/4.
 */
public class Salesman {

    public void saleTicket() {


    }

    public void chargeCard(Passenger p, int count, int i) {

        if (p.isCard()) {
            if (p.card.getBalance() < new DeductionsRules().getPrice(i)) {

                p.card.setBalance(p.card.getBalance() + count);
                System.out.println("余额不足，充值" + (count) + "元");

            } else {

                System.out.println("余额充足，无需充卡");
            }

        }else {

            p.card.setBalance(20);
            System.out.println("办卡成功，充值"+ p.card.getBalance()+"元" );
        }

    }
}

